<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <style>
        
        </style>
        
        </h:head>
    <h:body>
       <div id="col-top"></div>
    <div id="col" >
       
        <h:outputText value="#{msg['label_of_col.code']}"/>
        <p:inputText  required="true" label="#{msg['label_of_col.code']}" value="#{beancontroler_.codecola}" style="width:100px;margin-left: 2.5%">
         <p:ajax event="change"  listener="#{beancontroler_.validarcodigocolaborador()}" />  
        
        </p:inputText><br/><br/>
        <h:outputText value="#{msg['label.name.col']}"/>
        <p:inputText required="true" label="#{msg['label.name.col']}" value="#{beancontroler_.nombrecola}" style="width:  500px;margin-left: 1%"/><br/><br/>
        <h:outputText value="#{msg['label.ape.col']}"/>
        <p:inputText required="true" label="#{msg['label.ape.col']}" value="#{beancontroler_.apellidoscola}" style="width:  500px;margin-left: 1%"/><br/><br/>
        
        <p:commandButton style="margin-left: 16%;" rendered="#{beancontroler_.permisocreate}" disabled="#{beancontroler_.rederedservicesadd}" icon="ui-icon-plusthick " update="@form" action="#{beancontroler_.agregarcolaborador()}" value="#{msg['label.add_col']}"/>
        <p:commandButton style="margin-left: 1%;"  update="@form" rendered="#{beancontroler_.permisodelte}" disabled="#{beancontroler_.renderedservicesdelete}" action="#{beancontroler_.actualizarcolaborador()}"    id="viewCommand" value="#{msg['label.update_col']}" icon="ui-icon-disk" />
        <p:commandButton style="margin-left: 1%;"  update="@form" rendered="#{beancontroler_.permisoupdate}" disabled="#{beancontroler_.renderedservicesupdate}" icon="ui-icon-trash"  action="#{beancontroler_.eliminarcolaborador()}"   id="updateco" value="#{msg['label.delete_col']}"  /><br/><br/>
           <p:inputText id="serch"  style="width: 570px;margin-left: 16%;background-image: url('icons/zoom.png');background-repeat: no-repeat;padding: 3px 3px 3px 25px; background-position: 4px 1px;    " value="#{beancontroler_.filltext}">
            <p:ajax event="keyup" update="dataTable" listener="#{beancontroler_.filtercolaboradores()}" />  
        </p:inputText>
   
        <p:dataTable   paginatorPosition="bottom" rowKey="#{cola.id}" selection="#{beancontroler_.selectedcolaboradores}"  selectionMode="single" style="width:600px;margin-left: 16%;" id="dataTable" var="cola" value="#{beancontroler_.listacola}"  
                 paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">  
            <p:ajax event="rowSelect"   update="@none"  oncomplete="updateContent()"   listener="#{beancontroler_.modificarcolaboradores()}"/>
        <f:facet name="header">  
         #{msg['label.list.cola']}
        </f:facet>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="#{msg['label.name.col']}" />  
            </f:facet>  
            <h:outputText value="#{cola.nombres}" />  
        </p:column> 
             <p:column>  
            <f:facet name="header">  
                <h:outputText value="#{msg['label.ape.col']}" />  
            </f:facet>  
                 <h:outputText value="#{cola.apellidos}" />  
        </p:column> 
             <p:column>  
            <f:facet name="header">  
                <h:outputText value="#{msg['label_of_col.code']}" />  
            </f:facet>  
                 <h:outputText value="#{cola.codeusu}" />  
        </p:column> 
  
    </p:dataTable>  
        
        
        
        
        
       
    
    </div> <!-- /col -->
    <div id="col-bottom"></div>
    </h:body>
</html>
